﻿USE [Test]
GO
/****** Object:  Table [dbo].[Insurer]    Script Date: 08/04/2010 11:58:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Insurer](
	[Id] [uniqueidentifier] NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
 CONSTRAINT [PK_Insurer] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Case]    Script Date: 08/04/2010 11:58:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Case](
	[Id] [uniqueidentifier] NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Status] [nvarchar](50) NOT NULL,
	[InsurerId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_Case] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Default [DF_Case_Id]    Script Date: 08/04/2010 11:58:32 ******/
ALTER TABLE [dbo].[Case] ADD  CONSTRAINT [DF_Case_Id]  DEFAULT (newid()) FOR [Id]
GO
/****** Object:  Default [DF_Insurer_Id]    Script Date: 08/04/2010 11:58:32 ******/
ALTER TABLE [dbo].[Insurer] ADD  CONSTRAINT [DF_Insurer_Id]  DEFAULT (newid()) FOR [Id]
GO
/****** Object:  ForeignKey [FK_Case_Insurer]    Script Date: 08/04/2010 11:58:32 ******/
ALTER TABLE [dbo].[Case]  WITH CHECK ADD  CONSTRAINT [FK_Case_Insurer] FOREIGN KEY([InsurerId])
REFERENCES [dbo].[Insurer] ([Id])
GO
ALTER TABLE [dbo].[Case] CHECK CONSTRAINT [FK_Case_Insurer]
GO
